package com.cn.service.server.sys.impl;

import com.cn.bean.dto.StatusOperationDto;
import com.cn.bean.pojo.sys.BusinessStateOperationSub_Table;
import com.cn.bean.pojo.sys.BusinessStatusOperationMainTable;
import com.cn.mapper.dao.db5.StatusOperationDao;
import com.cn.service.server.sys.StatusOperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StatusOperationServiceImpl implements StatusOperationService {
    @Autowired(required = false)
    private StatusOperationDao statusOperationDao;
    @Override
    public List<StatusOperationDto> selectStatusOperation(StatusOperationDto statusOperationDto) {
        return statusOperationDao.selectStatusOperation(statusOperationDto);
    }

    @Override
    public int insertStatusOperationMainTable(BusinessStatusOperationMainTable mainTable) {
        Boolean a=statusOperationDao.insertStatusOperationMainTable(mainTable);
        if (a){
            return 1;
        }
        return 0;
    }

    @Override
    public int insertStateOperationSubTable(BusinessStateOperationSub_Table subTable) {
        Boolean b=statusOperationDao.insertStateOperationSubTable(subTable);
        if (b){
            return 1;
        }
        return 0;
    }

    @Override
    public int delStatusOperationMain(int id) {
        Boolean c=statusOperationDao.delStatusOperationMain(id);
        if(c){
            return 1;
        }
        return 0;
    }

    @Override
    public List<StatusOperationDto> selectSub(int id) {
        return statusOperationDao.selectSub(id);
    }

    @Override
    public int delStatusOperationSub(int id) {
        Boolean d=statusOperationDao.delStatusOperationSub(id);
        if (d){
            return 1;
        }
        return 0;
    }

    @Override
    public List<StatusOperationDto> selectAll(StatusOperationDto statusOperationDto) {
        return statusOperationDao.selectAll(statusOperationDto);
    }

    @Override
    public Integer getStatusOperationM() {
        return statusOperationDao.getStatusOperationM();
    }

    @Override
    public Integer getStatusOperationSub() {
        return statusOperationDao.getStatusOperationSub();
    }

    @Override
    public int updateStatusOperationM(BusinessStatusOperationMainTable mainTable) {
        Boolean x=statusOperationDao.updateStatusOperationM(mainTable);
        if (x){
            return 1;
        }
        return 0;
    }
}
